package top.riske.animalhazardassessment.analyse.service.impl;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import top.riske.animalhazardassessment.analyse.service.AnalyseRiskConfig;
import top.riske.animalhazardassessment.analyse.service.AnalyseService;
import top.riske.animalhazardassessment.common.DTO.AnalyseDto;
import top.riske.animalhazardassessment.common.mapper.SpeciesMapper;

@Service
public class AnalyseServiceImpl implements AnalyseService {

    @Resource
    private SpeciesMapper speciesMapper;



    @Override
    public double analyse(AnalyseDto analyseDto) {
        double riskPoint = 0;

        riskPoint += analyseDto.getOcclusionRisk() * AnalyseRiskConfig.OCCLUSION_WEIGHT;

        riskPoint += analyseDto.getPhysiqueRisk() * AnalyseRiskConfig.PHYSIQUE_WEIGHT;

        riskPoint += analyseDto.getGeneRisk() * AnalyseRiskConfig.GENE_WEIGHT;

        riskPoint += analyseDto.getPreWarnRisk() * AnalyseRiskConfig.PREWARN_WEIGHT;

        riskPoint += analyseDto.getProtectFoodRisk() * AnalyseRiskConfig.PROTECTFOOD_WEIGHT;

        riskPoint += analyseDto.getOwnerPointRisk() * AnalyseRiskConfig.OWNERPOINT_WEIGHT;

        riskPoint += analyseDto.getVaccinesRisk() * AnalyseRiskConfig.VACCINES_WEIGHT;

        riskPoint += analyseDto.getEnvironmentRisk() * AnalyseRiskConfig.ENVIRONMENT_WEIGHT;

        riskPoint += analyseDto.getComplaintRisk() * AnalyseRiskConfig.COMPLAINT_WEIGHT;

        return  riskPoint;
    }




}
